A single mobile device may allow multiple applications to execute simultaneously. Several applications requiring sensor data often run concurrently within a user's mobile device. Two or more of these applications may need sensor measurements from a common type of sensor or the same sensor. Often the requirements for sensor data from separate applications vary. That is, one application may require samples from a sensor at a first periodic sampling rate while a second application requires data from the same sensor but at a second periodic sampling rate.
Typically, applications require sensor measurements at a periodic rate but a first application may need sensor measurements often while a second application may use measurements from the same sensor less frequently. For example, a first application may require measurement every 20 milliseconds (ms) (equivalent to a sampling rate of 50 Hz) and a second application may require measurements every 25 ms (equivalent to a sampling rate of 40 Hz).
Several approaches are available to accommodate different sampling rates. In a first approach, a mobile device may provide a corresponding number of sensors, each with its own sampler. That is, if there are N applications requiring sensor measurements, there are a corresponding N or more sensors. This approach requires a number of duplicative sensors and samplers, each consuming power and requiring circuit board real estate.
A second approach includes a single sensor but a plural number of samplers. This single-sensor approach has the advantage of saving some power but disadvantages associated with having of multiple samplers.
A third approach includes a single sensor with a single sampler. With this approach, a higher over-sampled sampling rate is used such that each of the various required sampling rates are found within the over-sampled sampling rate. That is, a periodic sampling rate is selected based on the least common multiple (LCM) of the different sampling rates, which typically results in a high LCM sampling rate and a large number of unused samples. The over-sampled sampling rate is the smallest number that is a multiple of each of the required sampling rates. For example, the LCM of 50 Hz (sampling rate of first application) and 40 Hz (sampling rate of first application) is 200 Hz (sampling rate of sampler). In this case, the sampler provides samples at a rate four times what is necessary for the first application and five times what is necessary for the second application.
Of the several approaches available, each having its various drawbacks in extra hardware requirements, power consumption and time necessary to process unused samples.